package com.qiang.test01;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class Demo02 {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress address = InetAddress.getByName("192.168.12.23");
        byte[] address1 = address.getAddress();
        String hostName = address.getHostName();
        String hostAddress = address.getHostAddress();

        //System.out.println(new String(address1));
        for (byte b : address1) {
            System.out.println(b);
        }
        System.out.println(hostAddress);
        System.out.println(hostName);
    }
}
